package cn.ly.core.inclass;

public class FieldOuterClass {//可以把成员内部类想象成一个类的成员变量，类型为对象类型
	private String outName;
	
	public FieldOuterClass(String name){
		this.outName = name;
	}
	
	private void callName(){
		System.out.println(this.outName);
	}
	
	public class InnerClass{
		private String innerName;
		
		public String getOutField(){
			return FieldOuterClass.this.outName;
		}
		
		public void callName(){
			System.out.println(this.innerName);
		}
		
		public void callOut(){
			System.out.print("inner call outer：");
			FieldOuterClass.this.callName();
		}
	}
	
	public static void main(String[] args) {
		FieldOuterClass outer = new FieldOuterClass("懒人...");
		FieldOuterClass.InnerClass inner = outer.new InnerClass();
		System.out.println(inner.getOutField());
		inner.callOut();
	}
	
	

}
